<template>
<el-dialog :visible.sync="visible" title="详情" :close-on-click-modal="false" :close-on-press-escape="false">
    <el-form :model="dataForm" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="100px">
        <el-row :gutter="30">
              <el-col :span="12">
                <el-form-item label="状态:">
                    <p class="txt">{{types2[dataForm.state]}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="12">
                <el-form-item label="投诉对象:">
                    <p class="txt">{{ dataForm.complainantObject }}</p>
                </el-form-item>
            </el-col>
            <el-col :span="12">
                <el-form-item label="投诉方ID:">
                    <p class="txt">{{ dataForm.complainantId }}</p>
                </el-form-item>
            </el-col>
            <el-col :span="12">
                <el-form-item label="联系电话:">
                    <p class="txt">{{ dataForm.complainantPhone }}</p>
                </el-form-item>
            </el-col>
             <el-col :span="12">
                <el-form-item label="投诉类型:">
                    <p class="txt">{{ types[dataForm.complainantType] }}</p>
                </el-form-item>
            </el-col>
            <el-col :span="24">
                <el-form-item label="投诉内容:">
                    <p class="txt">{{ dataForm.content }}</p>
                </el-form-item>
            </el-col>
            <el-col :span="24">
                <el-form-item label="回复内容:">
                    <p class="txt">{{ dataForm.reply }}</p>
                </el-form-item>
            </el-col>
            <el-col :span="24">
                <el-form-item label="图片:">
                    <el-image :src="pic" style="width:140px;height:140px;margin-right:10px" v-for="(pic,index) in dataForm.picList" :key="index" :preview-src-list="dataForm.picList"></el-image>
                </el-form-item>
            </el-col>
        </el-row>
    </el-form>
</el-dialog>
</template>

<script>
export default {
    data() {
        return {
            visible: false,
            dataForm: {},
            types: [
                "功能故障",
                "景区意见",
                "产品建议",
                "预订咨询",
                "订单咨询",
                "其他",
            ],
             types2: ["待处理", "处理中", "派单中", "已解决", "继续投诉"],
        };
    },
    computed: {},
    props: ['data'],
    methods: {
        init() {
            this.visible = true;
            this.$nextTick(() => {
                this.$refs["dataForm"].resetFields();
                this.dataForm = this.data;
            });
        }
    },
};
</script>

<style lang="scss" scoped>
.txt {
    line-height: 40px;
    height: auto;
    margin: 0;
    padding: 0;

    &.content {
        p {
            line-height: 26px;
            margin: 7px 0 0 0;
            padding: 0
        }

        img {
            width: 100%;
        }
    }
}
</style>
